package com.tj.jinzao.widgets;


import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;

import com.tj.jinzao.R;


/**
 * 签到
 * Created by wjy on 2019/1/6.s
 */
public class SignDialog extends Dialog {

    public SignDialog(Context context) {
        super(context);
    }

    public SignDialog(Context context, int theme) {
        super(context, theme);
    }

    public static class Builder {
        private Context mContext;
        private View mLayout;

        private SignDialog mDialog;

        public Builder(Context context) {
            this.mContext = context;
        }

        public SignDialog create() {
            return this.create(R.layout.dialog_sign_ok);
        }

        public SignDialog create(int layoutRes) {
            LayoutInflater inflater = (LayoutInflater) mContext
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            // instantiate the dialog with the custom Theme
            mDialog = new SignDialog(mContext, R.style.Dialog);
            mLayout = inflater.inflate(layoutRes, null);
            mDialog.addContentView(mLayout, new LayoutParams(
                    LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
            return mDialog;
        }
    }

}
